<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Cookie {
    
    public static function set( $name , $value , $time = '' )
    {
        $cookie = new CHttpCookie( $name ,$value );
        $cookie->expire = $time ? $time : time()+60*60*24*30 ;
        App()->request->cookies[$name]=$cookie;
    }
    
    public static function get( $name )
    {
        
        return  App()->request->cookies[$name];
    }
    
    public static function del( $name )
    {
        unset( App()->request->cookies[$name] );
    }
}